.TH E1432_BLOCK_AVAILABLE 3 E1432
.SH NAME
e1432_block_available \- Return status of data FIFO
.IX e1432_block_available(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_block_available(E1432ID hw, SHORTSIZ16 ID)
.cE
.SH DESCRIPTION
\fIe1432_block_available\fR returns one of three status conditions:

- A positive number if a block of data is available to be read.  Use
  \fIe1432_read_raw_data\fR, \fIe1432_read_float32_data\fR, or
  \fIe1432_read_float64_data\fR to read the data.

- Zero if a block of data is not available.

- A (negative) error number if an error occurred.

When the E1432 is set to block mode, using \fIe1432_set_data_mode\fR
with \fBE1432_BLOCK_MODE\fR, the module stops acquiring data after one
block of data for each active channel has accumulated in the FIFO.
The module does not acquire more data until the block has been read
out of the FIFO.

When the E1432 is set to overlap block mode, using
\fIe1432_set_data_mode\fR with \fBE1432_DATA_MODE_OVERLAP_BLOCK\fR,
the module acquires data continuously (as with continuous mode, below)
but will stop momentarily if the FIFO fills up, so there will never be
a FIFO overflow.

When the E1432 is set to continuous mode, using
\fIe1432_set_data_mode\fR with \fBE1432_CONTINUOUS_MODE\fR, the module
continues to acquire data until the E1432 is re-initialized with
\fIe1432_init_measure\fR or the FIFO overflows because data is not read
out fast enough.

If the FIFO overflows in continuous mode, data acquisition stops.  Data
remaining in the FIFO is valid and can be read.
\fIe1432_block_available\fR returns 1 as long as at least a block of
data remains in the FIFO.  Calls to \fIe1432_block_available\fR when
the FIFO is empty because of data overflow will return the error
\fBERR1432_FIFO_OVERRUN\fR.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

The usage of \fIe1432_block_available\fR varies depending upon whether
a group ID or channel a ID is used.  If a group ID is used,
\fIe1432_block_available\fR will return positive when every channel in
the group has a block ready for reading.

When given a group ID, the \fIe1432_block_available\fR function
internally does some group-related operations to ensure that the group
remains synchronized properly.  For this reason, \fBit is almost always
better to use a group ID than a channel ID for this function\fR.

If a channel ID is used, \fIe1432_block_available\fR will return
positive when that channel has a block that is ready to be read.

The concept of having a block of data ready makes sense only for input
channels, not for tach or source channels, so
\fIe1432_block_available\fR normally ignores any tach or source
channels that are present in the group \fIID\fR.  However, there is
one exception to this rule.  In a multi-module RPM-arm or order
tracking measurement, if one module has no active input channels, but
does have active tach channels, the tach channels must be in the group
ID passed to \fIe1432_block_available\fR.  The reason that that this
is necessary is to ensure that the RPM arms and the tach data stay
synchronized between all of the modules.
.SH EXAMPLE
.cS
  /* wait for data, handle errors */
  while(!(error = e1432_block_available(groupID)));
  if (error < 0)
      call_error_handler_routine();
  else
      e1432_read_raw_data(groupID, buffer, size, &actualCount);
.cE
.SH "RESET VALUE"
Not applicable.
.SH "RETURN VALUE"
Return positive if successful, 0 if no data available, a (negative)
error number if error.  The two most likely errors returned will be
ERR1432_FIFO_OVERRUN and ERR1432_TACH_BUFFER_OVERFLOW.  
.SH "SEE ALSO"
.na
e1432_read_raw_data, e1432_read_float32_data, e1432_read_float64_data,
e1432_get_raw_tachs, e1432_send_tachs
.ad
